package com.analyse.stock.vo;

import lombok.Data;

import java.io.Serializable;

/**
 * 返回给前端的数据封装
 * Created by liang on 2021-03-11.
 */
@Data
public class ResultVo<T> implements Serializable {
    private static final long serialVersionUID = -4414926978700453869L;

    /**
     * 状态马
     */
    private Integer code;

    /**
     * 状态说明
     */
    private String msg;

    /**
     * 返回数据
     */
    private T data;

    public boolean successful(){
        return code != null && code.intValue() == 200;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}